bignum1 = []
bignum2 = []
bignum3 = []
def isdigit(num):
    if num == '1' or num == '2' or num == '3' or num == '4' or num == '5' or num == '6' or num == '7' or num == '8' or num == '9' or num == '0':
        return True
    return False

def kboardin(bignum):
    inval = input()
    for i in inval:    
        if isdigit(i) == False:
            print("error")
            return False
    for i in inval:
        bignum.append(i)
    return True
#        print("apendi:::",i)
        
def lennormorlize():
    global bignum1
    global bignum2
    head = []
    if len(bignum1) != len(bignum2):
        if len(bignum1) > len(bignum2):
            for i in range(0,len(bignum1) - len(bignum2)):
#                print("len:",len(bignum1) - len(bignum2))
#                print("i:",i)
                head.append(0)
#                print("appending")
#                print("head",head)
#                print("bignum2",bignum2)
            bignum2 = head + bignum2
#            print("bignum2:",bignum2)
        else:
            for i in range(0,len(bignum2) - len(bignum1)):
                head.append(0)
            bignum1 = head + bignum1

def allchange(num):
    cnum = []
    for i in range(len(num) - 1,-1,-1):
        cnum.append(num[i])
    return cnum

def minus():
#    print("Running")
    global bignum1
    global bignum2
    global bignum3
    lennormorlize()
    m = 0
    s = 1
    i = len(bignum1) - 1
#    print(i)
    while s > 0 or m > 0:
        print("Running")
#        flag = False
        m = 0
        if i >= 0:
            a = bignum1[i]
            b = bignum2[i]
#            aa = int(bignum1[i - 1])
            bignum1[i - 1] = int(bignum1[i - 1])
            if int(a) < int(b):
                s = int(10 + int(a)) - int(b) - int(m)
                bignum1[i - 1] = bignum1[i - 1] - 1
#            flag = True
#        if flag == False:
#        s -= int(m)
#        m = s // 10
#        s = s % 10
        bignum3.append(s)
#        print(bignum3)    
#        if flag == False:
#            s = 0
        i -= 1
    ans = allchange(bignum3)
    return ans

def output(ans):
    print(ans)
    
def main():
    re1 = kboardin(bignum1)
    while re1 == False:
        re1 = kboardin(bignum1)
    re2 = kboardin(bignum2)
    while re2 == False:
        re2 = kboardin(bignum2)
    ans = minus()
    output(ans)
    
main()
